home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group93b.txt / 000106_icon-group-sender _Sat May 15 19:16:59 1993.msg < prev    next >
Internet Message Format  |  1993-06-16  |  2KB

  1. Received: from owl.CS.Arizona.EDU by cheltenham.cs.arizona.edu; Thu, 20 May 1993 08:01:56 MST
  2. Received: by owl.cs.arizona.edu; Thu, 20 May 1993 08:01:53 MST
  3. Date: 15 May 93 19:16:59 GMT
  4. From: dog.ee.lbl.gov!pasteur!agate!howland.reston.ans.net!ux1.cso.uiuc.edu!uwm.edu!linac!uchinews!ellis!goer@ucbvax.Berkeley.EDU  (Richard L. Goerwitz)
  5. Organization: University of Chicago
  6. Subject: Re: string stripping
  7. Message-Id: <1993May15.191659.22110@midway.uchicago.edu>
  8. References: <9305141710.AA04578@midway.uchicago.edu>, <1993May15.080016.8080@smds.com>
  9. Sender: icon-group-request@cs.arizona.edu
  10. To: icon-group@cs.arizona.edu
  11. Status: R
  12. Errors-To: icon-group-errors@cs.arizona.edu
  13.  
  14. rh@ishmael.UUCP (Richard Harter) writes:
  15. >
  16. >>Sean states:
  17. >
  18. >>    If i have a string and i want to strip out certain characters
  19. >>    (internal ones, so trim won't do it), ...
  20. >
  21. >>This is a good problem
  22. >
  23. >It seems to me that this is the sort of thing that would be a one liner
  24. >in languages that are strong in string processing.
  25.  
  26. It is a one-liner.  The posting you are responding to suggested a one-
  27. liner that seemed reasonably crisp:  every base ||:= !full -- badchars.
  28. A simple idiom, although not crystal clear to the uninitiated (kind of
  29. like putting sed "s/\.-//g" in front of a newbie).
  30.  
  31. The fact is that the longer scanning solutions were actually far more
  32. clear and elegant, and they demonstrate a general methodology for sol-
  33. ving string processing problems that is far more powerful and flexible
  34. than what you'll find in most supposed "string processing" languages.
  35.  
  36. Not to demean languages that use regular expressions.  Though cryptic
  37. and restricted in power, they are useful.  Each tool has its own pur-
  38. pose.
  39.  
  40. -- 
  41.  
  42.    -Richard L. Goerwitz              goer%midway@uchicago.bitnet
  43.    goer@midway.uchicago.edu          rutgers!oddjob!ellis!goer
  44.